package com.chen.model;

import lombok.Data;

import java.io.Serializable;

/**
 * @Author: chen
 * @Date: 2021/5/24 2:23 PM
 * @Version 1.0
 */
@Data
public class OrderEvent implements Serializable {

    /**
     * 时间戳
     */
    private final long timestamp;

    /**
     * 事件携带的对象
     */
    protected transient Object source;

    /**
     * 未携带事件对象的构造函数
     */
    public OrderEvent() {
        this.timestamp = System.currentTimeMillis();
    }

    /**
     * 携带了事件对象的构造函数
     * @param source
     */
    public OrderEvent(Object source) {
        this.timestamp = System.currentTimeMillis();
        this.source = source;
    }

}
